package com.ruoyi.equipment.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.equipment.domain.FzEquipmentKey;
import com.ruoyi.equipment.mapper.FzEquipmentKeyMapper;
import com.ruoyi.equipment.service.IFzEquipmentKeyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

/**
 * 设备钥匙Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-03-22
 */
@Service
public class FzEquipmentKeyServiceImpl implements IFzEquipmentKeyService
{
    @Autowired
    private FzEquipmentKeyMapper fzEquipmentKeyMapper;

    /**
     * 查询设备钥匙
     * 
     * @param keyId 设备钥匙ID
     * @return 设备钥匙
     */
    @Override
    public FzEquipmentKey selectFzEquipmentKeyById(String keyId)
    {
        return fzEquipmentKeyMapper.selectFzEquipmentKeyById(keyId);
    }

    /**
     * 查询设备钥匙列表
     * 
     * @param fzEquipmentKey 设备钥匙
     * @return 设备钥匙
     */
    @Override
    public List<FzEquipmentKey> selectFzEquipmentKeyList(FzEquipmentKey fzEquipmentKey)
    {
        return fzEquipmentKeyMapper.selectFzEquipmentKeyList(fzEquipmentKey);
    }

    /**
     * 新增设备钥匙
     * 
     * @param fzEquipmentKey 设备钥匙
     * @return 结果
     */
    @Override
    public int insertFzEquipmentKey(FzEquipmentKey fzEquipmentKey)
    {
        fzEquipmentKey.setCreateTime(DateUtils.getNowDate());
        return fzEquipmentKeyMapper.insertFzEquipmentKey(fzEquipmentKey);
    }

    /**
     * 修改设备钥匙
     * 
     * @param fzEquipmentKey 设备钥匙
     * @return 结果
     */
    @Override
    public int updateFzEquipmentKey(FzEquipmentKey fzEquipmentKey)
    {
        fzEquipmentKey.setUpdateTime(DateUtils.getNowDate());
        return fzEquipmentKeyMapper.updateFzEquipmentKey(fzEquipmentKey);
    }

    /**
     * 删除设备钥匙对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFzEquipmentKeyByIds(String ids)
    {
        return fzEquipmentKeyMapper.deleteFzEquipmentKeyByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除设备钥匙信息
     * 
     * @param keyId 设备钥匙ID
     * @return 结果
     */
    @Override
    public int deleteFzEquipmentKeyById(String keyId)
    {
        return fzEquipmentKeyMapper.deleteFzEquipmentKeyById(keyId);
    }
}
